package com.innovation.cmd;

import com.innovation.exception.PatException;
import com.innovation.message.ServerMessageProto.ServerMessage;
import com.innovation.message.ServerMessageProto.ServerMessage.Builder;

public abstract class BaseCmd implements Command {
	@Override
	public Builder execute(ServerMessage request) throws PatException {
		ServerMessage.Builder response = ServerMessage.newBuilder();
		done(request, response);
		return response;
	}

	/**
	 * 子类实现
	 * @param request
	 * @param response
	 * @throws PatException
	 */
	protected abstract void done(ServerMessage request, ServerMessage.Builder response) throws PatException;
}
